<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<!--[if IE 8]>
<html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]>
<html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <include file="Public:meta"/>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
<include file="Public:header"/>
<!-- BEGIN CONTAINER -->
<div class="page-container">
    <include file="Public:sidebar"/>
    <!-- BEGIN PAGE -->
    <div class="page-content">
        <!-- BEGIN PAGE CONTAINER-->
        <div class="container-fluid">
            <!-- BEGIN PAGE HEADER-->
            <div class="row-fluid">
                <!-- begin BCN -->
                <div class="row-fluid">
                    <div class="span12"><ul class="breadcrumb"><li><i class="icon-home"></i><a onfocus="blurLink(this);" href="{:U('Index/index')}">首页</a>&nbsp;<span class="icon-angle-right"></span>&nbsp;</li><li><a onfocus="blurLink(this);" href="{:U(CONTROLLER_NAME . '/index', 'kept=1')}">{$ParentPageName|default="未命名"}</a>&nbsp;<span class="icon-angle-right"></span>&nbsp;</li><li>{$PageName|default="未命名"}</li></ul></div>
                </div>
                <!-- end BCN -->
            </div>
            <!-- END PAGE HEADER-->
            <!-- BEGIN PAGE CONTENT-->
            <div class="row-fluid white">
                <div class="span12">
                    <!-- begin 操作与分页 -->
                    <div class="row-fluid ">
                        <div class="dataTables_length pull-left">
                            <form id="limit_form" name="limit_form" method="post" action="">
                                <label for="limit_num">
                                    <select class="limit_num" id="limit_num" name="limit_num">
                                    <volist name="page_limit_num" id="vo">
                                        <option <eq name="_SESSION['page_limit_num']" value="$vo"> selected="selected" </eq> value="{$vo}">{$vo}</option>
                                    </volist>
                                    </select>
                                    个记录/每个页面
                                </label>
                            </form>
                        </div>
                        <div class="btn-item pull-left">
                            <!-- begin 导出操作 -->
                            <if condition="checkAccess(CONTROLLER_NAME,'export')">
                                <notempty name="list">
                                    <a class="btn green export" href="javascript:void(0)">数据导出<i class="icon-plus"></i></a>
                                </notempty>
                            </if>
                            <!-- end 导出操作 -->
                        </div>
                    </div>
                    <!-- end 操作与分页 -->
                    <div class="portlet-body">
                        <table class="table table-striped table-hover table-bordered">
                            <thead>
                                <tr>
                                    <volist name="index_content" id="vo">
                                        <th class='hidden-phone'>{$vo.label}</th>
                                    </volist>
                                    <th>管理操作</th>
                                </tr>
                            </thead>
                            <notempty name="list">
                                <tbody>
                                    <volist name="list" id="vo">
                                        <tr>
                                            <volist name="index_content" id="item">
                                                <td class="hidden-phone" data-field="{$key}" data-id="{$vo.id}">
                                                    <!-- start判断是否为图片 -->
                                                    <if condition="$item['field'] eq 'wxlogo'">
                                                        <img style="display:inline-block;width:50px;height:50px;" src="{$vo[$item['field']]}" />
                                                    <else/>
                                                        {$vo[$item['field']]}
                                                    </if>  
                                                    <!-- end判断是否为图片 --> 
                                                </td>
                                            </volist>
                                            <td>
                                                <if condition="checkAccess(CONTROLLER_NAME, 'setColonel')">
                                                    <eq name="vo.is_colonel" value="0">
                                                        <a class="btn green-stripe set" href="javascript:void(0)" data-id="{$vo['id']}" data-url="{:U(CONTROLLER_NAME.'/setColonel')}">设置超级团长</a>
                                                    </eq>
                                                </if>
                                            </td>
                                        </tr>
                                    </volist>
                                </tbody>
                            </notempty>
                        </table>
                    </div>
                    <div class="pages clearfix">
                        <include file="Public:page" />
                    </div>
                </div>
            </div>
            <!-- END PAGE CONTENT-->
        </div>
        <!-- END PAGE CONTAINER-->
    </div>
    <!-- END PAGE -->
</div>
<!-- END CONTAINER -->

<include file="Public:footer"/>
<script type="text/javascript">
    jQuery(document).ready(function () {
        //数据导出
        $('.export').click(function(){
            url = "{:U(CONTROLLER_NAME.'/export')}";
            window.location.href = url;
        });

        //设置超级团长
        $('body').on('click','.set',function(){
            var id = $(this).data('id');
            var url = $(this).data('url');
            custom_confirm('确定设置该用户为超级团长？',function(){
                $.ajax({
                    type:'post',
                    dataType: 'json',
                    url:url,
                    data:{
                        id:id
                    },
                    success:function(rs){
                        if(rs.status){
                            window.location.href = rs.url;
                        }else{
                            custom_alert(rs.info);
                        }
                    }
                });
            })
        })
    });
</script>
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>